package com.chexiehui.jc.ui.fragment;

import android.os.Bundle;
import android.widget.TextView;

import com.aries.ui.view.radius.RadiusTextView;
import com.chexiehui.jc.R;
import com.chexiehui.jc.base.BaseFragment;
import com.chexiehui.jc.entity.UserInfo;
import com.chexiehui.jc.utils.AppCommonUtil;
import com.chexiehui.jc.utils.SerializableSpTools;

import butterknife.BindView;
import butterknife.OnClick;

public class ChangePhoneShowFragment extends BaseFragment {

    public static ChangePhoneShowFragment getInstance() {
        ChangePhoneShowFragment fragment = new ChangePhoneShowFragment();
        return fragment;
    }

    @BindView(R.id.tv_phone)
    TextView tvPhone;
    @BindView(R.id.rtv_next)
    RadiusTextView rtvNext;

    private UserInfo userInfo;
    private PageNextListener pageNextListener;

    @Override
    protected void beforeSetView() {
        userInfo = SerializableSpTools.getUserInfo();
    }

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_change_phone_show;
    }

    @Override
    protected void initView(Bundle savedInstanceState) {
        tvPhone.setText(AppCommonUtil.phoneMask(userInfo.getTel()));
    }

    @OnClick(R.id.rtv_next)
    public void onViewClicked() {
        if(pageNextListener != null){
            pageNextListener.onChangePhoneShowNext();
        }
    }

    public interface PageNextListener {
        void onChangePhoneShowNext();
    }

    public void setPageNextListener(PageNextListener pageNextListener) {
        this.pageNextListener = pageNextListener;
    }
}
